void main() {
	buffer results;
	results.append(visit_url());

	string alt = '<span style="font-weight:normal;color:#1975FF">';
	
	// inventory page option
	results.replace_string('inventory.php">inventory</a>',
	  'inventory.php?which=1">inv</a><a target=mainpane href="inventory.php?which=2">'+alt+'ent</span></a><a target=mainpane href="inventory.php?which=3">ory</a> <a target=mainpane href="inventory.php?which=f0">fav</a>');
	
	// crafting page option
	results.replace_string('craft.php">crafting</a>', 'craft.php">craft</a><a target=mainpane href="craft.php?mode=discoveries">'+alt+'ing</span></a>');
	
	// quests page option
	results.replace_string('questlog.php">quests</a>', 'questlog.php?which=1">qu</a><a target=mainpane href="questlog.php?which=4">'+alt+'es</span></a><a target=mainpane href="questlog.php?which=6">ts</a>');
	
	// messages page option
	results.replace_string('messages.php">messages</a>', 'messages.php?box=Inbox">mes</a><a target=mainpane href="messages.php?box=Outbox">'+alt+'sag</span></a><a target=mainpane href="sendmessage.php">es</a>');
	
	// reduce clutter
	results.replace_string("campground</a>","camp</a>");
	
	// Cosmic Kitchen
	if(my_path() == "Avatar of Jarlsberg")
		results.replace_string('camp</a>','camp</a> <a target=mainpane href="shop.php?whichshop=jarl">kitchen</a>');
	
	// Go straight to bookshelf from campground.
	boolean have_bookshelf() {
		if(in_bad_moon() || my_path() == "Avatar of Boris") return false;
		foreach s in $skills[Summon Alice's Army Cards, Summon BRICKOs, Summon Candy Hearts, Summon Love Song,
		  Summon Party Favor, Summon Stickers, Summon Sugar Sheets, Summon Tasteful Items]
			if(have_skill(s)) return true;
		return false;
	}
	if(have_bookshelf())
		results.replace_string("campground.php","campground.php?action=bookshelf");
	
	// add either VIP or sofa link, depending
	if(item_amount($item[VIP lounge key]) > 0)
		  results.replace_string("clan_hall.php\">clan</a>",
		    "clan_hall.php\">clan</a> <a target=mainpane href=\"clan_viplounge.php\">VIP</a>");
	else results.replace_string("clan_hall.php\">clan</a>",
	  "clan_hall.php\">clan</a> <a target=mainpane href=\"clan_rumpus.php?action=click&spot=5&furni=3\">sofa</a>");
	
	// add beanstalk, knob, manor, sea
	if (my_level() > 9) results.replace_string("plains</a>","plains</a> <a target=mainpane href=\"beanstalk.php\">bean</a>");
	if (my_level() > 4) results.replace_string("plains</a>","plains</a> <a target=mainpane href=\"cobbsknob.php\">knob</a>");
	if(get_property("lastManorUnlock") == my_ascensions())
		results.replace_string("town</a>","town</a> <a target=mainpane href=\"manor.php\">manor</a>");
	else results.replace_string("town</a>","town</a> <a target=mainpane href=\""+to_url($location[haunted pantry])+"\">pantry</a>");
	
	// add guild
	string guild = "guild.php?guild=";
	if(my_path() == "Avatar of Boris") guild = "da.php?place=gate1";
	else if(my_path() == "Avatar of Jarlsberg") guild = "da.php?place=gate2";
	else if(my_path() == "Avatar of Sneaky Pete") guild = "da.php?place=gate3";
	else if(my_path() == "Zombie Slayer") guild = "campground.php?action=grave";
	else if(my_primestat() == $stat[muscle]) guild += "f";
	else if(my_primestat() == $stat[mysticality]) guild += "m";
	else if(my_primestat() == $stat[moxie]) guild += "t";
	results.replace_string("<a href=\"#\" onClick='javascript:window.open(\"doc.php?",
	  "<a target=mainpane href=\""+guild+"\">guild</a> <a href=\"#\" onClick='javascript:window.open(\"doc.php?");
	// sea
	if(available_amount($item[makeshift SCUBA gear]) > 0)
		results.replace_string("<br><a href=\"#\" onClick",
		  "<br><a target=mainpane href=\"oldman.php\">sea</a> <a href=\"#\" onClick");
	
	// image links to public charsheet
	results.replace_string("valign=center><img src=\"http://images.kingdomofloathing.com/otherimages/",
	  "valign=center><a target=mainpane href=\"showplayer.php?who="+my_id()+"\"><img title=\"View Public Charsheet\" src=\"http://images.kingdomofloathing.com/otherimages/");
	results.replace_string("smallleftswordguy.gif\" width=33 height=40>", "smallleftswordguy.gif\" width=33 height=40></a>");
 	
	
	// Add a few images to the right...
	int lastTr = last_index_of( results , "</table>" ) +length("</table>");
	string divright = "<div style='position: absolute; right: 130px; bottom: 0px;'>";
	results.replace(lastTr , lastTr , divright+"</div>");
	lastTr += length(divright);

	// add image link to basement logs
	results.replace(lastTr, lastTr, '<a href=\"clan_raidlogs.php" target="mainpane"><img src="http://images.kingdomofloathing.com/adventureimages/hobofort.gif" height=50 width=50 style="align: right; border: 0" /></a>');
	
	// Add image link to the Florist
	results.replace( lastTr , lastTr , '<a href="forestvillage.php?action=floristfriar" target="mainpane">' +
	  '<img src="http://images.kingdomofloathing.com/otherimages/forestvillage/friarcottage.gif" height=68 width=68 style="margin:0 0 0 0; overflow:hidden; align:right; border:0" /></a>');
	
	// Change pvp to PvP
	results.replace_string(">pvp<", ">PvP<");
	
	// Fix link to bugbear mothership
	if(my_path() == "Bugbear Invasion")
		results.replace_string("whichplace=bugbearship_outside", "whichplace=bugbearship");
	
	results.write();
}